package com.tencreat.domain.account;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * 供应商对象 mall_supplier
 *
 * @author tencreat
 * @date 2021-11-10
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("mall_supplier")
public class MallSupplier extends BaseEntity<MallSupplier> {
    private static final long serialVersionUID = 1L;


    /**
     * $column.columnComment
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;


    /**
     * 用户ID
     */
    @Excel(name = "用户ID",sort = 1)
    @ApiModelProperty(value = "用户ID")
    @TableField("`uuid`")
    private Long uuid;


    /**
     * 用户表的用户ID
     */

    @ApiModelProperty(value = "用户表的用户ID")
    @TableField("`user_id`")
    private Long userId;

    /**
     * 用户名称
     */
    @Excel(name = "供应商名称",sort = 3)
    @ApiModelProperty(value = "用户名称")
    @TableField("`username`")
    private String username;

    /** 行政区域表的省ID */
    @ApiModelProperty(value= "行政区域表的省ID")
    @TableField("`province`")
    private Long province;

    /** 行政区域表的市ID */
    @ApiModelProperty(value= "行政区域表的市ID")
    @TableField("`city`")
    private Long city;

    /** 行政区域表的区县ID */
    @ApiModelProperty(value= "行政区域表的区县ID")
    @TableField("`county`")
    private Long county;

    /**
     * 账号
     */
    @ApiModelProperty(value = "账号")
    @TableField("`account`")
    private String account;

    /**
     * 用户手机号码
     */
    @Excel(name = "手机号码",sort = 2)
    @ApiModelProperty(value = "用户手机号码")
    @TableField("`mobile`")
    private String mobile;


    /**
     * 详细地址
     */
    @Excel(name = "详细地址",sort = 6)
    @ApiModelProperty(value = "详细地址")
    @TableField("`address`")
    private String address;


    /**
     * 身份证正面
     */
    @ApiModelProperty(value = "身份证正面")
    @TableField("`front_of_id_card`")
    private String frontOfIdCard;


    /**
     * 身份证背面
     */
    @ApiModelProperty(value = "身份证背面")
    @TableField("`back_of_id_card`")
    private String backOfIdCard;

    /**
     * 0 待审核, 1 审核成功, 2 审核驳回
     */
    @Excel(name = "审核状态",sort = 8,readConverterExp = "0=待审核,1=审核成功,2=审核驳回")
    @ApiModelProperty(value = "审核状态：0 待审核, 1 审核成功, 2 审核驳回")
    @TableField("`approval_status`")
    private Integer approvalStatus;

    /**
     * 0 可用, 1 禁用, 2 注销
     */
    @Excel(name = "供应商状态",sort = 7,readConverterExp = "0=正常,1=禁用,2=注销")
    @ApiModelProperty(value = "供应商状态：0 可用, 1 禁用, 2 注销")
    @TableField("`status`")
    private Integer status;


    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    @TableField("`del_flag`")
    private String delFlag;


    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    @TableField("`tenant_id`")
    private Long tenantId;

    /**
     * 省市区拼接
     */
    @Excel(name = "省市区",sort =5)
    @ApiModelProperty(value = "省市区拼接")
    @TableField(exist = false)
    private String areasName;

    @Excel(name = "申请时间",sort =9, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "申请时间")
    @TableField(exist = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime applyTime;

/*    @ApiModelProperty(value = "营业执照")
    @TableField("`business_license`")
    private String businessLicense;*/

    @ApiModelProperty("申请时间开始")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private LocalDateTime startTime;

    @ApiModelProperty("申请时间结束")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private LocalDateTime endTime;

    @Excel(name = "货款",sort = 4)
    @ApiModelProperty("货款")
    @TableField(exist = false)
    private BigDecimal  supplierEarnings;

    @ApiModelProperty("排序字段")
    @TableField(exist = false)
    private String sortStr;

    @ApiModelProperty("排序规则")
    @TableField(exist = false)
    private String sortDesc;
}
